package com.heima.media.feign;

import com.heima.common.dto.ResponseResult;
import com.heima.media.dto.ArticleDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("leadnews-article")
public interface ArticleFeign {
    @PostMapping("/api/v1/article")
    public ResponseResult<Long> saveArticle(@RequestBody ArticleDto dto);

    /**
     * 根据文章id查询
     *
     * @param id
     * @return
     */
    @GetMapping("/api/v1/article/findAuthorNameById")
    public ResponseResult<String> findAuthorNameById(@RequestParam("id") Long id);
}
